package net.whg.java.abstrac;

import java.util.ArrayList;
import java.util.List;

public class ShapeDemo {

    public static void main(String[] args) {
        List<Shape> list = new ArrayList<>();
        list.add(new Rect(10, 20));
        list.add(new Circle(10));
        list.add(new EquilateralTriangle(10));
        list.add(new RightTriangle(3,4));
        for (Shape shape : list) {
            shape.draw();
            shape.calculateArea();
            System.out.println(shape.getArea());
        }
    }
}
